#ifndef __func_H__
#define __func_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <sys/uio.h>
#include <dirent.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <fcntl.h>
#include <signal.h>
#include <pthread.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <shadow.h>

#define ARGS_CHECK(argc, n){\
    if (argc != n){\
        fprintf(stderr, "args error: expected %d arguments\n", n);\
        exit(1);\
    }\
}

#define ERROR_CHECK(retVal, val, msg)\
    do {\
        if (val == retVal){\
            perror(msg);\
                exit(1);\
        }\
    }while(0)

#define THREAD_ERROR_CHECK(retVal, msg) \
    do {\
        if (retVal != 0) {\
            printf("%s: %s\n", msg, strerror(retVal));\
            exit(1);\
        }\
    }while(0)



#endif
